home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / emacssrc.zip / EMACSSRC.TAR / emacs-19.17 / src / nmkfile < prev    next >
Text File  |  1993-12-09  |  6KB  |  261 lines

  1. #
  2. #  Hacked up Nmake makefile for GNU Emacs
  3. #
  4. #   Tim Fleehart (apollo@online.com)        17-Apr-92
  5. #   Geoff Voelker (voelker@cs.washington.edu)    11-20-93
  6. #
  7. #  This file is part of GNU Emacs.
  8. #  
  9. #  GNU Emacs is free software; you can redistribute it and/or modify
  10. #  it under the terms of the GNU General Public License as published by
  11. #  the Free Software Foundation; either version 2, or (at your option)
  12. #  any later version.
  13. #  
  14. #  GNU Emacs is distributed in the hope that it will be useful,
  15. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. #  GNU General Public License for more details.
  18. #  
  19. #  You should have received a copy of the GNU General Public License
  20. #  along with GNU Emacs; see the file COPYING.  If not, write to
  21. #  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  22. #
  23.  
  24. #
  25. # You must have a some of environment variables set:
  26. #
  27. #     BUILD_DEFAULT_TARGETS must be set to one of "-mips" ,"-386", or "-alpha"
  28. #        Build for mips assumes r4000.
  29. #
  30. #    INC must ne set the full path to your NT .h files.
  31. #
  32. #    LIB must be set to the full path to your NT .lib files.
  33. #
  34. #
  35.  
  36. #
  37. # Set up compiler flags
  38. #
  39. !IF "$(BUILD_DEFAULT_TARGETS)" == "-mips"
  40. # Set up the compiler flags for building on mips
  41.  
  42. ARCH          = mips
  43. CFLAGS           = -nologo -D_MIPS_=1 /c /W3 /Od -Gt0 \
  44.         -D__stdcall= -D__cdecl= -DWIN32_LEAN_AND_MEAN
  45.  
  46. # disable optimization --- it hangs emacs
  47.  
  48. !ELSE
  49. !IF "$(BUILD_DEFAULT_TARGETS)" == "-386"
  50. # Set up the compiler flags for building on x86
  51.  
  52. ARCH           = i386
  53. CFLAGS           = -nologo -D_X86_=1 -c -Zedl -W2 -H63 -G3d -Ox
  54.  
  55. !ELSE
  56. !IF "$(BUILD_DEFAULT_TARGETS)" == "-alpha"
  57. # Set up the compiler flags for building on alpha
  58.  
  59. ARCH            = alpha
  60. CFLAGS          = -D_ALPHA_=1 -c -Zed -W2 -Ox\
  61.                  -D__stdcall= -D__cdecl= -DWIN32_LEAN_AND_MEAN
  62. !ELSE
  63. !ERROR You must specify BUILD_DEFAULT_TARGETS as either -alpha -mips or -386.
  64. !ENDIF
  65. !ENDIF
  66. !ENDIF
  67.  
  68. !IFNDEF INC
  69. !ERROR You need to set INC to the NT .h files directory.
  70. !ELSE
  71. INCP = -I. -I$(INC) -I$(INC)\crt
  72. !ENDIF
  73.  
  74. !IFNDEF LIB
  75. !ERROR You need to set LIB to the NT .lib files directory.
  76. !ENDIF
  77.  
  78. #
  79. # HAVE_CONFIG_H is required by some generic gnu sources stuck into
  80. # the emacs source tree.
  81. #
  82. GENERICFLAGS  = -Demacs=1 -DWINDOWSNT -DHAVE_CONFIG_H
  83.  
  84. NAME           =    emacs
  85. OBJDIR          = obj
  86. BLD          =    $(OBJDIR)\$(ARCH)
  87.  
  88. TARGET          = $(BLD)\$(NAME).exe
  89. TLIB           =    $(BLD)\$(NAME).lib
  90. TOBJ           =    $(BLD)\$(NAME).obj
  91.  
  92.  
  93. #
  94. # Split up the objects into two sets so that we don't run out of
  95. # command line space when we link them into a library.
  96. #
  97. OBJ1 =    $(BLD)\abbrev.obj    \
  98.     $(BLD)\alloc.obj    \
  99.     $(BLD)\alloca.obj    \
  100.     $(BLD)\buffer.obj    \
  101.     $(BLD)\bytecode.obj    \
  102.     $(BLD)\callint.obj    \
  103.     $(BLD)\callproc.obj    \
  104.     $(BLD)\casefiddle.obj    \
  105.     $(BLD)\cm.obj        \
  106.     $(BLD)\cmds.obj        \
  107.     $(BLD)\crt0.obj        \
  108.     $(BLD)\data.obj        \
  109.     $(BLD)\dired.obj    \
  110.     $(BLD)\dispnew.obj    \
  111.     $(BLD)\doc.obj        \
  112.     $(BLD)\doprnt.obj    \
  113.     $(BLD)\editfns.obj    \
  114.     $(BLD)\eval.obj        \
  115.     $(BLD)\fileio.obj    \
  116.     $(BLD)\filelock.obj    \
  117.     $(BLD)\filemode.obj    \
  118.     $(BLD)\fns.obj        \
  119.     $(BLD)\indent.obj    \
  120.     $(BLD)\insdel.obj    \
  121.     $(BLD)\keyboard.obj    \
  122.     $(BLD)\keymap.obj    \
  123.     $(BLD)\lastfile.obj    \
  124.     $(BLD)\lread.obj    \
  125.     $(BLD)\macros.obj    \
  126.     $(BLD)\marker.obj    \
  127.     $(BLD)\minibuf.obj    \
  128.     $(BLD)\mocklisp.obj
  129.  
  130. OBJ2 =     $(BLD)\ntinevt.obj    \
  131.     $(BLD)\ntproc.obj    \
  132.     $(BLD)\ntterm.obj    \
  133.     $(BLD)\print.obj    \
  134.     $(BLD)\process.obj    \
  135.     $(BLD)\regex.obj    \
  136.     $(BLD)\scroll.obj    \
  137.     $(BLD)\search.obj    \
  138.     $(BLD)\syntax.obj    \
  139.     $(BLD)\sysdep.obj    \
  140.     $(BLD)\term.obj        \
  141.     $(BLD)\termcap.obj    \
  142.     $(BLD)\tparam.obj    \
  143.     $(BLD)\undo.obj        \
  144.     $(BLD)\window.obj    \
  145.     $(BLD)\xdisp.obj    \
  146.     \
  147.     $(BLD)\casetab.obj    \
  148.     $(BLD)\floatfns.obj    \
  149.     $(BLD)\frame.obj    \
  150.     $(BLD)\getloadavg.obj    \
  151.     $(BLD)\gmalloc.obj    \
  152.     $(BLD)\intervals.obj    \
  153.     $(BLD)\prefix-args.obj    \
  154.     $(BLD)\ralloc.obj    \
  155.     $(BLD)\textprop.obj    \
  156.     $(BLD)\vm-limit.obj
  157.  
  158. LIBS =    $(TLIB)            \
  159.     $(LIB)\setargv.obj    \
  160.     $(LIB)\kernel32.lib    \
  161.     $(LIB)\advapi32.lib    \
  162. $(LIB)\libc.lib
  163.  
  164.  
  165. !IF "$(BUILD_DEFAULT_TARGETS)" == "-mips"
  166. #
  167. #
  168. # mips
  169. #
  170. #
  171.  
  172. $(TARGET): $(LIBS) $(TOBJ)
  173.     link32 -stack:0x2000000 -base:0xc00000 -out:$(TARGET) -debug:PARTIAL -debugtype:COFF -machine:mips -subsystem:console -entry:mainCRTStartup $(TOBJ) $(LIBS)
  174.  
  175.  
  176. #
  177. # Split up the library build into two phases...otherwise we run out of
  178. # command line space.
  179. #
  180. $(TLIB): $(OBJ1) $(OBJ2)
  181.     @- lib32 -out:$(TLIB) $(OBJ1)
  182.     @- lib32 -out:$(TLIB) $(TLIB) $(OBJ2)
  183.  
  184. .c{$(BLD)}.obj:
  185.     @- if not exist $(OBJDIR) md $(OBJDIR) >nul 2>&1
  186.     @- if not exist $(BLD) md $(BLD) >nul 2>&1
  187.     @- chmode -r $@ >nul 2>&1
  188.     @- del $@ >nul 2>&1
  189.     mcl $(CFLAGS) $(GENERICFLAGS) $(INCP) -Fo$@ $<
  190.  
  191. !ELSE
  192. !IF "$(BUILD_DEFAULT_TARGETS)" == "-alpha"
  193. $(TARGET): $(LIBS) $(TOBJ)
  194.     link32 -stack:0x2000000 -base:0xc00000 -out:$(TARGET) -debug:PARTIAL -debugtype:COFF -machine:alpha -subsystem:console -entry:mainCRTStartup $(TOBJ) $(LIBS)
  195.  
  196.  
  197. #
  198. # Split up the library build into two phases...otherwise we run out of
  199. # command line space.
  200. #
  201. $(TLIB): $(OBJ1) $(OBJ2)
  202.     @- lib32 -out:$(TLIB) $(OBJ1)
  203.     @- lib32 -out:$(TLIB) $(TLIB) $(OBJ2)
  204.  
  205. .c{$(BLD)}.obj:
  206.     @- if not exist $(OBJDIR) md $(OBJDIR) >nul 2>&1
  207.     @- if not exist $(BLD) md $(BLD) >nul 2>&1
  208.     @- chmode -r $@ >nul 2>&1
  209.     @- del $@ >nul 2>&1
  210.     claxp $(CFLAGS) $(GENERICFLAGS) $(INCP) -Fo$@ $<
  211. !ELSE
  212. #
  213. #
  214. # i386
  215. #
  216. #
  217.  
  218. $(TARGET): $(LIBS) $(TOBJ)
  219.     link32 -stack:0x2000000 -base:0xc00000 -out:$(TARGET) -debug:PARTIAL -debugtype:COFF -machine:i386 -align:0x1000 -subsystem:console -entry:mainCRTStartup $(TOBJ) $(LIBS)
  220.  
  221. #
  222. # Split up the library build into two phases...otherwise we run out of
  223. # command line space.
  224. #
  225. $(TLIB): $(OBJ1) $(OBJ2)
  226.     @- lib32 -out:$(TLIB) $(OBJ1)
  227.     @- lib32 -out:$(TLIB) $(TLIB) $(OBJ2)
  228.  
  229. .c{$(BLD)}.obj:
  230.     @- if not exist $(OBJDIR) md $(OBJDIR) >nul 2>&1
  231.     @- if not exist $(BLD) md $(BLD) >nul 2>&1
  232.     @- chmode -r $@ >nul 2>&1
  233.     @- del $@ >nul 2>&1
  234.     cl386 $(CFLAGS) $(GENERICFLAGS) $(INCP) -Fo$@ $<
  235.  
  236. !ENDIF
  237. !ENDIF
  238.  
  239. #
  240. # Build the executable
  241. #
  242. all:        $(TARGET)
  243.  
  244.  
  245. #
  246. # Assuming INSTALL_DIR is defined, build and install emacs in it.
  247. #
  248. CP           = xcopy /fr
  249. install:    all
  250.         - mkdir $(INSTALL_DIR)\bin
  251.         $(CP) $(TARGET) $(INSTALL_DIR)\bin
  252.  
  253. #
  254. # Maintenance
  255. clean:;        del /q *~
  256.         delnode /q deleted
  257.         delnode /q obj
  258.  
  259.  
  260.